package model

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(60)" json:"username"`
	Password string `gorm:"type:varchar(60)" json:"password"`
}

type UserRole struct {
	gorm.Model
	Uid int `gorm:"type:int" json:"uid"`
	Rid int `gorm:"type:int" json:"rid"`
}

type Role struct {
	gorm.Model
	Name string `gorm:"type:varchar(60)" json:"name"`
}

type RoleNode struct {
	gorm.Model
	Rid int `gorm:"type:int" json:"rid"`
	Nid int `gorm:"type:int" json:"nid"`
}

type Node struct {
	gorm.Model
	Name string `gorm:"type:varchar(60)" json:"name"`
}

//商品管理

type Good struct {
	gorm.Model
	GoodCode string `gorm:"type:varchar(60)" json:"good_code"`
	GoodName string `gorm:"type:varchar(60)" json:"good_name"`
}

type GoodOrder struct {
	gorm.Model
	OrderCode  string `gorm:"type:varchar(60)" json:"order_code"`
	OrderPrice int    `gorm:"type:int" json:"order_price"`
	Gid        int    `gorm:"type:int" json:"gid"`
}

type GoodOrderList struct {
	GoodOrderId int    `gorm:"type:int" json:"good_order_id"`
	GoodCode    string `gorm:"type:varchar(60)" json:"good_code"`
	GoodName    string `gorm:"type:varchar(60)" json:"good_name"`
	OrderCode   string `gorm:"type:varchar(60)" json:"order_code"`
	OrderPrice  string `gorm:"type:varchar(60)" json:"order_price"`
}
